package com.nhancv.kurentoandroid;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class loginActivity extends AppCompatActivity {

    public static String playerid;
    @Override

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        final EditText editText1 = findViewById(R.id.counter);
        final EditText editText2 = findViewById(R.id.password);
        Button button1 = findViewById(R.id.btn_login);
        Button button2 = findViewById(R.id.btn_register);
        Button button3 = findViewById(R.id.btn_exit);
        button1.setOnClickListener(v -> {
            playerid = editText1.getText().toString();
            String s2 = editText2.getText().toString();
            Toast.makeText(loginActivity.this,"欢迎"+playerid, Toast.LENGTH_LONG).show();
            loginActivity.this.finish();
        });
        button2.setOnClickListener(v -> {
            Intent intent = new Intent(loginActivity.this,registerActivity.class);
            startActivity(intent);
        });

        button3.setOnClickListener(v -> {
            Toast.makeText(loginActivity.this,"游客登陆", Toast.LENGTH_LONG).show();
            loginActivity.this.finish();
        });

    }
}
